﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FlowProcessLogEdit.aspx.cs"
    Inherits="BEGDC.CC.Web.Workflow.Admin.FlowProcessLogEdit" %>

<%@ Register TagPrefix="cc1" Namespace="BEGDC.CC.Web.Control" Assembly="ASBCC.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
    <title>Edit Process Log 编辑流程日志</title>
    <base target="_self" />
    <link href="../../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">

        function SelectUser(userId_CtrlID, userEn_CtrlID) {
            vela3OpenSelectSingleUserDialog('../../',
	                    userId_CtrlID,
	                    '',
	                    userEn_CtrlID,
	                    '',
	                    '');
        }

        function SelectOwner() {
            SelectUser("hidOwnerID", "txtOwnerEn");
        }

        function SelectDelegateFrom() {
            SelectUser("hidDelegateFromID", "txtDelegateFromEn");
        }

        function ClearDelegateFrom() {
            var hidDelegateFromID = document.getElementById("SearchStaff2_Employee_ID");
            var txtDelegateFromEn = document.getElementById("SearchStaff2_Employee_Name");
            //var hidDelegateFromCn = document.getElementById("hidDelegateFromCn");
            hidDelegateFromID.value = "";
            txtDelegateFromEn.value = "";
            //hidDelegateFromCn.value = "";
        }

        function checkProcInstID(source, arguments) {
            var txtProcInstID = document.getElementById("txtProcInstID");
            var isValid = false;
            if (txtProcInstID.value != "") {
                isValid = (txtProcInstID.value.match(/^\d+$/) != null);
            }
            arguments.IsValid = isValid;
        }

        function checkCreatedDate(source, arguments) {
            var txtCreatedDate = document.getElementById("txtCreatedDate");
            arguments.IsValid = (parseDate(txtCreatedDate.value) != null);
        }

        function parseDate(str) {
            if (typeof str == 'string') {
                var results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);
                if (results && results.length > 3)
                    return new Date(parseInt(results[1]), parseInt(results[2]) - 1, parseInt(results[3]));
                results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/);
                if (results && results.length > 6)
                    return new Date(parseInt(results[1]), parseInt(results[2]) - 1, parseInt(results[3]), parseInt(results[4]), parseInt(results[5]), parseInt(results[6]));
                results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/);
                if (results && results.length > 7)
                    return new Date(parseInt(results[1]), parseInt(results[2]) - 1, parseInt(results[3]), parseInt(results[4]), parseInt(results[5]), parseInt(results[6]), parseInt(results[7]));
            }
            return null;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <h3 class="ev-header-section">
        &nbsp;Edit Process Log</h3>
    <table width="100%">
        <tr class="ev-row2">
            <td class="title">
                <asp:Label ID="lblID" runat="server">ID：</asp:Label>
            </td>
            <td class="val">
                <asp:Label ID="lblIDValue" runat="server"></asp:Label>
            </td>
            <td class="title">
                <asp:Label ID="lblProcName" runat="server" Text="Process Name 流程名称："></asp:Label>
            </td>
            <td class="val">
                <asp:DropDownList ID="ddlProcName" runat="server">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="valProcName" runat="server" ErrorMessage="Process Name is required."
                    ControlToValidate="ddlProcName" Visible="False" Display="None"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <asp:Label ID="lblActivityName" runat="server" Text="Step Name 步骤名称："></asp:Label>
            </td>
            <td class="val">
                <asp:DropDownList ID="ddlActivityName" runat="server" Width="142px">
                </asp:DropDownList>
            </td>
            <td class="title">
                <asp:Label ID="lblActionType" runat="server" Text="Action 操作："></asp:Label>
            </td>
            <td class="val">
                <asp:DropDownList ID="ddlActionType" runat="server">
                    <asp:ListItem Value="" Text=""></asp:ListItem>
                    <asp:ListItem Value="Submit" Text="Submit"></asp:ListItem>
                    <asp:ListItem Value="Resubmit" Text="Resubmit"></asp:ListItem>
                    <asp:ListItem Value="Approve" Text="Approve"></asp:ListItem>
                    <asp:ListItem Value="Reject" Text="Reject"></asp:ListItem>
                    <asp:ListItem Value="Review" Text="Review"></asp:ListItem>
                    <asp:ListItem Value="Forward" Text="Forward"></asp:ListItem>
                    <asp:ListItem Value="ForwardBack" Text="ForwardBack"></asp:ListItem>
                    <asp:ListItem Value="ReplyForwardBack" Text="ReplyForwardBack"></asp:ListItem>
                    <asp:ListItem Value="AskForMore" Text="AskForMore"></asp:ListItem>
                    <asp:ListItem Value="ReplyAskForMore" Text="ReplyAskForMore"></asp:ListItem>
                    <asp:ListItem Value="Discard" Text="Discard"></asp:ListItem>
                    <asp:ListItem Value="Drawback" Text="Drawback"></asp:ListItem>
                    <asp:ListItem Value="Withdraw" Text="Withdraw"></asp:ListItem>
                    <asp:ListItem Value="Redirect" Text="Redirect"></asp:ListItem>
                    <asp:ListItem Value="Goto" Text="Goto"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <asp:Label ID="lblOwner" runat="server" Text="Owner 拥有人："></asp:Label>
            </td>
            <td class="val">
                <cc1:UserSearchControl2 ID="SearchStaff1" runat="server"></cc1:UserSearchControl2>
                <asp:HiddenField ID="hidOwnerID" runat="server" />
                <asp:HiddenField ID="hidOwnerCn" runat="server" />
            </td>
            <td class="title">
                <asp:Label ID="lblDelegateFrom" runat="server" Text="Delegate 被代理人："></asp:Label>
            </td>
            <td class="val">
                <cc1:UserSearchControl2 ID="SearchStaff2" runat="server"></cc1:UserSearchControl2>
                &nbsp;<img alt="" onclick="ClearDelegateFrom()" style="cursor: hand;" src="../../images/del.gif" />
                <asp:HiddenField ID="hidDelegateFromID" runat="server" />
                <asp:HiddenField ID="hidDelegateFromCn" runat="server" />
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <asp:Label ID="lblApplicationNo" runat="server" Text="Application No. ：<br/>申请单号&nbsp;&nbsp;"></asp:Label>
            </td>
            <td class="val">
                <asp:TextBox ID="txtApplicationNo" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="valApplicationNo" runat="server" ErrorMessage="Application No is required."
                    ControlToValidate="txtApplicationNo" Visible="False" Display="None"></asp:RequiredFieldValidator>
            </td>
            <td class="title">
                <asp:Label ID="lblProcInstID" runat="server" Text="Process Instance ID ：<br/>流程实例ID&nbsp;&nbsp;"></asp:Label>
            </td>
            <td class="val">
                <asp:TextBox ID="txtProcInstID" runat="server"></asp:TextBox>
                <asp:CustomValidator ID="valCustomProcInstID" runat="server" ErrorMessage="Proc Inst ID should be number."
                    ControlToValidate="txtProcInstID" ClientValidationFunction="checkProcInstID"
                    ValidateEmptyText="true" Display="None"></asp:CustomValidator>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <asp:Label ID="lblCreatedDate" runat="server" Text="Create Date 创建日期："></asp:Label>
            </td>
            <td class="val">
                <asp:TextBox ID="txtCreatedDate" runat="server"></asp:TextBox>&nbsp;
                <asp:CustomValidator ID="valCustomCreatedDate" runat="server" ErrorMessage="Created Date is invalid."
                    ControlToValidate="txtCreatedDate" ClientValidationFunction="checkCreatedDate"
                    ValidateEmptyText="true" Display="None"></asp:CustomValidator>
            </td>
            <td class="title">
            </td>
            <td class="val">
            </td>
        </tr>
        <tr class="ev-row2">
            <td colspan="4" class="padding5 ac">
                <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn" OnClick="btnSave_Click">
                </asp:Button>&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnGoBack" runat="server" Text="Close" CssClass="btn" OnClientClick="window.close();return false;">
                </asp:Button>
            </td>
        </tr>
    </table>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" />
    </form>
</body>
</html>